package cs575.wido.model;

import cs575.client.Task;
import cs575.client.WiDo;
import cs575.client.WiDo_Service;
import cs575.wido.TaskListFactory;
import cs575.wido.UserSession;
import cs575.wido.WebServiceFactory;
import java.util.List;

public class CurrentTaskModel extends TaskModel {
	public CurrentTaskModel(TaskListFactory factory) {
		super();
		tasks = factory.getTaskList();
		
	}

	@Override
	public int getRowCount() {
		return tasks.size();
	}
       

	@Override
	public Object getValueAt(int arg0, int arg1) {
            System.out.println(arg0 + " : " + arg1);
            switch(arg1){
                case 0:
                    return tasks.get(arg0).getTaskName();
                case 1:
                    return tasks.get(arg0).getTaskDescription();
                case 2:
                    return (tasks.get(arg0).getStatus() == 1 ? "Active" : "Completed");
                case 3:
                    return tasks.get(arg0).getDueDate().toString();
            }
            return "";
	}

	/* TODO
	 * 
	 */
	public void fireChanges() {
		fireTableDataChanged();
	}
}
